<?php
	interface idbSmart{
		public function fetchOne();
		public function fetchAll();
	}
	
	class dbSmart implements idbSmart{
		public function fetchOne(){
			echo "fetch one".'<br />';
		}
		
		public function fetchAll(){
			//echo "fetch all";
			$str="mra@indian.in.vn";
			$pos=strpos($str,'@');
			echo $pos.'<br />';
			$astr = explode('@',$str);
			print_r($astr).'<br />';
			echo end($astr).'<br />';
			echo $rpos = strrpos($str,'.').'<br />';
			echo $strend = substr($str,$rpos+1).'<br />';
			$arr = array('how','are','you','?');
			$str1 = implode('<br />',$arr);
			echo $str1.'<br />';
			$reg='/^[0-9]+$/';
			$strinput = '123a';
			
			//{{a}}
			$strs = "how are you?";
			$a = "are";
			$u = "you?";
			$str2 = "how $a $u";
			echo addslashes($str2).'<br />';
			echo preg_match($reg,$strinput).'<br />';
			
			//file_get_contents(string filename);
		}
	}
	
	$db = new dbSmart();
	//$db->fetchOne();
	$db->fetchAll();
	// ham strpos(); strrpos();
	//strpos('chuoibandau','ki tu can tim') tra ve vi tri cua ki tu tim duoc
	/* ajax with jquery 
	* JSON: 
	*/
?>